package com.space.config;

import lombok.Data;


public class Tables {
    public static String activeDB=DB.db4.data;

    public static String getCreateSql(String db){
        if(DB.db1.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_configuration (  id TEXT NOT NULL PRIMARY KEY,    data text);";
        if(DB.db2.data.equals(db)) return  "CREATE TABLE IF NOT EXISTS ui_configuration (id VARCHAR(255) PRIMARY KEY, data LONGTEXT);";
        if(DB.db3.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_configuration (id VARCHAR(255) PRIMARY KEY, data TEXT);";
        if(DB.db4.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_configuration (id VARCHAR(255) PRIMARY KEY, data LONGVARCHAR);";
        if(DB.db5.data.equals(db)) return  "CREATE TABLE IF NOT EXISTS ui_configuration (id VARCHAR(255) PRIMARY KEY, data TEXT);";
        return "CREATE TABLE IF NOT EXISTS ui_configuration (  id TEXT NOT NULL PRIMARY KEY,    data text);";
    }

    public static String getCreateUserSql(String db){
        if(DB.db1.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_user (  id TEXT NOT NULL PRIMARY KEY,    password text);";
        if(DB.db2.data.equals(db)) return  "CREATE TABLE IF NOT EXISTS ui_user (id VARCHAR(255) PRIMARY KEY, password LONGTEXT);";
        if(DB.db3.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_user (id VARCHAR(255) PRIMARY KEY, password TEXT);";
        if(DB.db4.data.equals(db)) return "CREATE TABLE IF NOT EXISTS ui_user (id VARCHAR(255) PRIMARY KEY, password LONGVARCHAR);";
        if(DB.db5.data.equals(db)) return  "CREATE TABLE IF NOT EXISTS ui_user (id VARCHAR(255) PRIMARY KEY, password TEXT);";
        return "CREATE TABLE IF NOT EXISTS ui_user (  id TEXT NOT NULL PRIMARY KEY,    password text);";
    }
}
